From: Andrew Cooper Date: Thu, 25 Jun 2015 12:56:26 +0000 (+0200) Subject: common/vsprintf: special-case DOMID_IDLE handling for %pv X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3028 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=319e431e40139e27d871cbe53976b423301a6af0;p=xen.git common/vsprintf: special-case DOMID_IDLE handling for %pv Prints IDLEv0 as opposed to d32767v0 Signed-off-by: Andrew Cooper --- diff --git a/xen/common/vsprintf.c b/xen/common/vsprintf.c index 065cc42525..51b5e4e4d1 100644 --- a/xen/common/vsprintf.c +++ b/xen/common/vsprintf.c @@ -336,9 +336,14 @@ static char *pointer(char *str, char *end, const char **fmt_ptr, const struct vcpu *v = arg; ++*fmt_ptr; - if ( str < end ) - *str = 'd'; - str = number(str + 1, end, v->domain->domain_id, 10, -1, -1, 0); + if ( unlikely(v->domain->domain_id == DOMID_IDLE) ) + str = string(str, end, "IDLE", -1, -1, 0); + else + { + if ( str < end ) + *str = 'd'; + str = number(str + 1, end, v->domain->domain_id, 10, -1, -1, 0); + } if ( str < end ) *str = 'v'; return number(str + 1, end, v->vcpu_id, 10, -1, -1, 0);